package com.meixiang.entity.shopping;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * 商品规格中的商品信息
 *
 * @author LZRUI
 */
public class SpecTagGoodsEntity implements Parcelable {

    private String goodsName; // 商品名称
    private String goodsStorePrice; // 店铺价格
    private String goodsMarketPrice; // 市场价格
    private String goodsImage; // 商品图片
    private String goodsStorage; // 总库存数

    public SpecTagGoodsEntity(String goodsName, String goodsStorePrice, String goodsMarketPrice, String goodsImage, String goodsStorage) {
        this.goodsName = goodsName;
        this.goodsStorePrice = goodsStorePrice;
        this.goodsMarketPrice = goodsMarketPrice;
        this.goodsImage = goodsImage;
        this.goodsStorage = goodsStorage;
    }

    public SpecTagGoodsEntity() {
    }

    public String getGoodsName() {
        return goodsName == null ? "" : goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    public String getGoodsStorePrice() {
        return goodsStorePrice == null ? "" : goodsStorePrice;
    }

    public void setGoodsStorePrice(String goodsStorePrice) {
        this.goodsStorePrice = goodsStorePrice;
    }

    public String getGoodsMarketPrice() {
        return goodsMarketPrice == null ? "" : goodsMarketPrice;
    }

    public void setGoodsMarketPrice(String goodsMarketPrice) {
        this.goodsMarketPrice = goodsMarketPrice;
    }

    public String getGoodsImage() {
        return goodsImage == null ? "" : goodsImage;
    }

    public void setGoodsImage(String goodsImage) {
        this.goodsImage = goodsImage;
    }

    public String getGoodsStorage() {
        return goodsStorage == null ? "0" : goodsStorage;
    }

    public void setGoodsStorage(String goodsStorage) {
        this.goodsStorage = goodsStorage;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.goodsName);
        dest.writeString(this.goodsStorePrice);
        dest.writeString(this.goodsMarketPrice);
        dest.writeString(this.goodsImage);
        dest.writeString(this.goodsStorage);
    }

    protected SpecTagGoodsEntity(Parcel in) {
        this.goodsName = in.readString();
        this.goodsStorePrice = in.readString();
        this.goodsMarketPrice = in.readString();
        this.goodsImage = in.readString();
        this.goodsStorage = in.readString();
    }

    public static final Creator<SpecTagGoodsEntity> CREATOR = new Creator<SpecTagGoodsEntity>() {
        @Override
        public SpecTagGoodsEntity createFromParcel(Parcel source) {
            return new SpecTagGoodsEntity(source);
        }

        @Override
        public SpecTagGoodsEntity[] newArray(int size) {
            return new SpecTagGoodsEntity[size];
        }
    };
}
